Page({
  data: {
    indicatorDots: false,
    vertical: false,
    autoplay: false,
    photoNow:0,
    showModal:true,
    // 轮播图
    imgUrls: [{link: '/pages/logs/logs',url: '/img/2.png',},{link: '/pages/index/index',url: '/img/costmetics.png', },],
    imgs:[{img:'http://img.0808hy.cn/2.png'},{img:'http://img.0808hy.cn/2.png'},{img:'http://img.0808hy.cn/2.png'}],
    gd_notice_texts:[{name:'划线价格',desc:'可能是商品的吊牌价、零售价、指导价或该商品曾经在小程序展示过的销售价，并非原价。也由于地区与时间的差异，可能使划线价格与您购物时的展示价格不同。因此，该价格仅供做为参考用途。'},{name:'未划线价格',desc:'未划线价格:是商品的实际销售价。具体成交价格会因会员使用优惠券或参与活动而发生变化(本公司保有变更活动内空的最终解释权利，最終价格以订单结算页为主。'}],
    initList:{price:3,unit:'盒',name:'伊利利乐包纯牛奶',standards:'250ml',desc:'甄选奶源做中国好牛奶(新老包装随机发货)',num:1,detail1:'伊利',detail2:'纯牛奶',detail3:'全脂牛奶',detail4:'1454'}
  },
  touchStart:function(e){
    console.log(e)
    this.setData({
      photoNow:e.currentTarget.dataset.id+1
    })
  },
  onShareAppMessage: function () {
    return {
      title: '弹出分享时显示的分享标题',
      desc: '分享页面的内容',
      path: '/pages/user/index?id=1'
    }
  },
  showDialog: function () {
    this.showModal();
  },
      //显示对话框
  showModal: function () {
    // 显示遮罩层
    var animation = wx.createAnimation({
      duration: 200,
      timingFunction: "linear",
      delay: 0
    })
    this.animation = animation
    animation.translateY(300).step()
    this.setData({
      animationData: animation.export(),
      showModalStatus: true
    })
    setTimeout(function () {
      animation.translateY(0).step()
      this.setData({
        animationData: animation.export()
      })
    }.bind(this), 200)
  },
  //隐藏对话框
  hideModal: function () {
    // 隐藏遮罩层
    var animation = wx.createAnimation({
      duration: 200,
      timingFunction: "linear",
      delay: 0
    })
    this.animation = animation
    animation.translateY(300).step()
    this.setData({
      animationData: animation.export(),
    })
    setTimeout(function () {
      animation.translateY(0).step()
      this.setData({
        animationData: animation.export(),
        showModalStatus: false
      })
    }.bind(this), 200)
  }
})